package com.chixing.day03_oop;

public class Person {
    private String personName;
    private int personAge;
    private char personGender;
    private String personMarry;

    public Person(String name, int age, String gender, String marry) {
        System.out.println("姓名 ：" + name + " " + "年龄 ：" + age + " " + "性别 ：" + gender + " " + "婚姻状况 ：" + marry);

    }

    public String getPersonName() {
        return personName;
    }

    public void setPersonName(String personName) {
        this.personName = personName;
    }

    public int getPersonAge() {
        return personAge;
    }

    public void setPersonAge(int personAge) {
        this.personAge = personAge;
    }

    public char getPersonGender() {
        return personGender;
    }

    public void setPersonGender(char personGender) {
        this.personGender = personGender;
    }

    public String getPersonMarry() {
        return personMarry;
    }

    public void setPersonMarry(String personMarry) {
        this.personMarry = personMarry;
    }

    public void CanMarry(Person person) {
        while (person.personGender == 0 && person.personGender == 1) {
            if ((person.personGender == '男') && (person.personAge >= 24) && (person.personMarry == "false")) {
                if ((person.personGender == '女') && (person.personAge >= 22) && (person.personMarry == "false")) {
                    System.out.println("可以");

                } else {
                    System.out.println("不可以");
                }

            }

            System.out.println("可以");
//            return false;
        }
        System.out.println("不可以");
//        return false;


    }
}
